﻿using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

using IfSoft.OA.Entities;

namespace IfSoft.OA.DataAccess
{
    public class RoleMap : EntityTypeConfiguration<Role>
    {
        public RoleMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties           
            this.Property(t => t.Name)            
               .HasMaxLength(50);           

            // Table & Column Mappings
            this.ToTable("Role");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Name).HasColumnName("Name");                   
            this.Property(t => t.Description).HasColumnName("Description");
            this.Property(t => t.Code).HasColumnName("Code");
        }
    }
}

